//
//  PrototypeTest.m
//  Charles
//
//  Created by Leo on 2019/6/6.
//  Copyright © 2019 charles. All rights reserved.
//

#import "PrototypeTest.h"
#import "Prototype.h"

@implementation PrototypeTest

+ (void)testProtoType {
    Manager *manager = [[Manager alloc]init];
    UnderlinePen *uPen = [[UnderlinePen alloc]initWithUlchar:'~'];
    MessageBox *mBox = [[MessageBox alloc]initWithDecochar:'*'];
    MessageBox *sBox = [[MessageBox alloc]initWithDecochar:'/'];
    
    [manager registerName:@"strong message" proto:uPen];
    [manager registerName:@"warning box" proto:mBox];
    [manager registerName:@"slash box" proto:sBox];
    
    id<Product>p1 = [manager create:@"strong message"];
    [p1 use:@"Hello,world."];
    
    id<Product>p2 = [manager create:@"warning box"];
    [p2 use:@"Hello,world."];
    
    id<Product>p3 = [manager create:@"slash box"];
    [p3 use:@"Hello,world."];
}

@end
